<html lang="en">
<head>
 <meta charset="UTF-8">
 <meta name="viewport" content="width=device-width, initial-scale=1.0">
 <meta http-equiv="X-UA-Compatible" content="ie=edge">
 <link rel="stylesheet" href="../public/css/node.css">
 <link rel="stylesheet" href="../public/css/bootstrap.min.css">
 <title>{{animes.title}} 集数查看</title>
</head>
<body>
    <ul id="nav" class="col-md-1 nav nav-pills nav-stacked">
        <li class="navItem txContainer col-md-12 col-xs-3 ">
          <div class="kb visible-lg visible-md"></div>
          <img src="../public/img/index/logo/logo.png" alt="" class="visible-lg-inline visible-md-inline">
          <div>后台管理</div>
        </li>
        {{each menu}}
        <li class="navItem col-md-12 col-xs-3"  data-area="{{$index + 1}}">{{ $value }}</li>
        {{/each}}
      </ul>
  <div id="animeTable" class="col-md-11">
    <div class="tableTitle">
      <a href="javascript:;" onclick="toRrefresh();"><span class="return"><img src="../public/img/index/other/back.png" alt=""></span></a>
      {{ animes.title }} 分集管理
    </div>
    <div class="table-responsive" >
        <table class="table table-striped">
          <thead>
            <tr>
           <th>#</th>
           <th>标题</th>
           <th>视频类型</th>
           <th>视频地址</th>
           <th class="add" id="addEpi" data-length="{{episodes.length}}">添加</th>
            </tr>
          </thead>
        <tbody>
         {{ each episodes }}
         <tr class="tbody">
           <td>{{ episodes.length - $index }}</td>
           <td class="title">{{ $value.title }}</td>
           <td class="title">{{ $value.typeValue == 0 ? '正集':'非正集'}}</td>
           <td  class="overText">{{ $value.url }}</td>
           <td>
             <a href="javascript:;" class="editEpi" data-value="{{$value}}" data-index="{{episodes.length - $index}}">编辑</a>

             <a href="javascript:;" class="deleteEpi" data-index="{{episodes.length - $index - 1}}" data-id="{{animes._id}}" data-title="{{$value.title}}">删除</a>
           </td>
         </tr>
         {{ /each }}
        </tbody>
       </table>
       <h3 class="noData" {{ episodes.length !=0 ? 'hidden' : null }}>暂无剧集，请添加！！！</h3>
      </div>

      <!--添加框-->
      <form action="/node/episodes/add" method="POST" target="nm_iframe" class="episodeForm hide" id="episodeAdd">
        <h2></h2>
        <span class="closeAdd">x</span>
        <input type="text" name="_id" class="form-control hide" id="animeTitle" placeholder="_id" value="{{animes._id}}">
        <div class="form-group">
          <label for="animeTitle">标题：</label>
          <input type="text" name="title" class="form-control" id="animeTitle" placeholder="标题名称" value="">   
        </div>
        <div class="form-group">
          <label for="animeTitle">视频地址：</label>
          <textarea type="text" name="url" class="form-control url1" id="animeTitle" placeholder="只能网络地址" value="" rows="4"></textarea>   
        </div>
        <div class="form-group">
          <label for="animeUpdate">剧集类型：</label>
          <label class="radio1">
            <input type="radio" name="type" id="optionsRadios1" value="0" checked >
            正集
          </label>              
          <label>
            <input type="radio" name="type" id="optionsRadios2" value="1" >
            非正集
          </label>
      </div>
         <input type="submit" value="完成" class="btn btn-default" id="addBtn"/>
      </form>

      <!--编辑框-->
      <form action="/node/episodes/edit" method="POST" target="nm_iframe" class="episodeForm hide" id="episodeEdit">
        <h2></h2>
        <span class="closeAdd">x</span>
        <input type="text" name="_id" class="form-control hide"  placeholder="_id" value="{{animes._id}}">
        <input type="number" name="index" class="form-control eId hide"  placeholder="id" value="">
        <div class="form-group">
          <label for="animeTitle">标题：</label>
          <input type="text" name="title" class="form-control titleE" id="animeTitle" placeholder="标题名称" value="">   
        </div>
        <div class="form-group">
          <label for="animeTitle">视频地址：</label>
          <textarea type="text" name="url" class="form-control url" id="animeTitle" placeholder="只能网络地址" value="" rows="4"></textarea>   
        </div>
        <div class="form-group">
          <label for="animeUpdate">剧集类型：</label>
          <label class="radio1">
            <input type="radio" name="type" id="optionsRadios0" value="0" checked >
            正集
          </label>              
          <label>
            <input type="radio" name="type" id="optionsRadios1" value="1" >
            非正集
          </label>
      </div>
         <input type="submit" value="完成" class="btn btn-default" id="editBtn"/>
      </form>

      <!--删除提示框-->
      <div class="episodeForm hide deleteNotice" id="deleteNotice2">
          <h3 style="height:26px"></h3>
          <span class="closeAdd">x</span>
          <!---->
          <a href="javascript:;" target="nm_iframe"><button class="btn btn-danger delete">删除</button></a>
          <button class="btn btn-default cancel">取消</button>    
      </div>

      <!--保存不跳转页面-->
      <iframe id="id_iframe" name="nm_iframe" style="display:none;"></iframe>

  </div>
  <div id="blackBg" class="hide"></div>
  
  
 <script src="../public/js/jquery-1.12.4.min.js"></script>
 <script src="../public/js/vue.min.js"></script>
 <script src="../public/js/vue-resource.min.js"></script>
 <script src="../public/js/common.js"></script>
 <script src="../public/js/node/index.js"></script>
</body>
</html>